% core_1.m
%
% mfile to process core_1
% provides core specific information needed in processing as well as some
% basic metadata
%
% by Patrick Dickhudt - Jan. 2011  pdickhudt@usgs.gov
%
% filter and data file names
dfld = '/Users/Grace/Desktop/SERDP Sediment YR141029 -R141110/YR141029 - CLAYBANK AND FERRY POINT CORES/GUST'; % folder containing data file
ffld = '/Users/Grace/Desktop/SERDP Sediment YR141029 -R141110/YR141029 - CLAYBANK AND FERRY POINT CORES/GUST/filters'; % folder containing filter file

filein = fullfile(dfld,'YR141029.txt');   % time series data file
filein2 = fullfile(ffld,'S5456filter.csv');  % Filter data saved as a .csv file

% Bottle switch times
day = '10/29/2014';
tstr{1}=[day ' 12:20:05'];
tstr{2}=[day ' 12:50:20'];
tstr{3}=[day ' 13:10:20'];
tstr{4}=[day ' 13:30:20'];
tstr{5}=[day ' 13:50:20'];
tstr{6}=[day ' 14:10:20'];
tstr{7}=[day ' 14:30:20'];
tstr{8}=[day ' 14:50:00'];

% make struct with core specific info

% the following need to be editted for each core
crinfo.ntun = 1;                    % turbidimeter number (1 or 2)
crinfo.rpmn = 1;                    % motor number (1 or 2)
crinfo.subsamp = 'n';               % were bottle samples subsamples 'y' or 'n'
crinfo.coren = 'S5456 FP core A';         % core number
crinfo.titlestr ='S5456 FP core A';       % for labelling plots - replace underscores with dashes etc. to improve appearance
crinfo.temp = 20.0;                   % water temp (C)
crinfo.lat = 28.65783;              % latitude
crinfo.lon = -92.38015;             % longitude
%crinfo.depth = ;                 % approximate depth (m)
crinfo.time  = '29-Oct-2014 08:31'; % core collection time
crinfo.corer = 'GOMEX';% coring device
crinfo.vessel = 'R/V Heron';     % coring platform
crinfo.op = 'G.Cartwright/K.Fall';     % operator
crinfo.timebase = 'EST';            % time base

% note any relevant info, core description, etc.
crinfo.note = {'Turb to bottle tube length = 100 cm';
               'Nice core';
               %'nearly level surface';
               %'~ 4 mm surface relief';
               %'slightly hummocky surface';
               %'some worm tubes'
               };
           
% the following are general and likely apply to all cores for a given
% system
crinfo.system = {'VIMS'}; % erosion system used
crinfo.tube = 100;  % turbidimeter to bottle tube length (cm)
crinfo.tstr = tstr;
crinfo.nsteps=7;
%crinfo.Aeff=0.0088382; %[m^2] effective area of sediment surface in core. - 4.5 inch OD tube (slow corer)
crinfo.Aeff=0.0068337; %[m^2] effective area of sediment surface in core. - 4 inch OD tube (multicorer)

crinfo.fields = {'crinfo = core / system specific data';
                 'ntun = turbidimeter number (1 or 2)';
                 'rpmn = motor number (1 or 2)';
                 'subsamp = were bottle samples subsamples y or n (string)';
                 'coren = core number';
                 'titlestr = for labelling plots - replace underscores with dashes etc. to improve appearance';
                 'temp = water temp (C)';
                 'lat = latitude';
                 'lon = longitude';
                 'depth = approximate depth (m)';
                 'time = core collection time';
                 'corer = coring device';
                 'vessel = coring platform';
                 'op = operator';
                 'timebase = time base (GMT,EST, etc.)';
                 'note = relevant info, core description, etc.';
                 'system = erosion system used';
                 'tube = turbidimeter to bottle tube length (cm)';
                 'tstr = bottle switch times';
                 'nsteps = number of steps';
                 'Aeff = [m^2] effective area of sediment surface in core'};


[tsdat,stepdat,erdat,fitdat]=procerode3_VIMS_despike(filein,filein2,crinfo);
%[tsdat,stepdat,erdat,fitdat]=procerode3_VIMS(filein,filein2,crinfo);


close('all')


open([crinfo.coren '_er.fig'])
open(['M_' crinfo.coren '.fig'])
open(['tau_' crinfo.coren '.fig'])
